home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / MoreAutoPush / MoreOpenTransport / MoreAutoPush.h < prev   
Encoding:
C/C++ Source or Header  |  2000-10-06  |  4.7 KB  |  109 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        MoreAutoPush.h
  3.  
  4.     Contains:    A simple framework for doing autopush properly.
  5.  
  6.     Written by: Quinn "The Eskimo!"
  7.  
  8.     Copyright:    Copyright © 1997-2000 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.     Disclaimer:    IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  11.                 ("Apple") in consideration of your agreement to the following terms, and your
  12.                 use, installation, modification or redistribution of this Apple software
  13.                 constitutes acceptance of these terms.  If you do not agree with these terms,
  14.                 please do not use, install, modify or redistribute this Apple software.
  15.  
  16.                 In consideration of your agreement to abide by the following terms, and subject
  17.                 to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  18.                 copyrights in this original Apple software (the "Apple Software"), to use,
  19.                 reproduce, modify and redistribute the Apple Software, with or without
  20.                 modifications, in source and/or binary forms; provided that if you redistribute
  21.                 the Apple Software in its entirety and without modifications, you must retain
  22.                 this notice and the following text and disclaimers in all such redistributions of
  23.                 the Apple Software.  Neither the name, trademarks, service marks or logos of
  24.                 Apple Computer, Inc. may be used to endorse or promote products derived from the
  25.                 Apple Software without specific prior written permission from Apple.  Except as
  26.                 expressly stated in this notice, no other rights or licenses, express or implied,
  27.                 are granted by Apple herein, including but not limited to any patent rights that
  28.                 may be infringed by your derivative works or by other works in which the Apple
  29.                 Software may be incorporated.
  30.  
  31.                 The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  32.                 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  33.                 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.                 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  35.                 COMBINATION WITH YOUR PRODUCTS.
  36.  
  37.                 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  38.                 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  39.                 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40.                 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  41.                 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  42.                 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  43.                 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44.  
  45.     Change History (most recent first):
  46.  
  47.          <1>     5/10/00    Quinn   First checked in.
  48. */
  49.  
  50. #pragma once
  51.  
  52. /////////////////////////////////////////////////////////////////////
  53.  
  54. // MIB Setup
  55.  
  56. #include "MoreSetup.h"
  57.  
  58. // Mac OS Interfaces
  59.  
  60. #include <OpenTransportProtocol.h>
  61.  
  62. /////////////////////////////////////////////////////////////////////
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67.  
  68. extern pascal OSStatus ValidateModuleExists(const char *moduleName);
  69.     // Verify that the specified module exists within the
  70.     // OT environment.    We do this by calling the "sad"
  71.     // module and asking it to check.  Returns kOTNotFoundErr
  72.     // if the module does not exist.
  73.  
  74. extern pascal OSStatus GetAutoPushList(const char *driverName, OTAutopushInfo *autoPushInfo);
  75.     // This is a high-level entry point into the framework.
  76.     // This routine returns the autopush information associated
  77.     // with the given driver.
  78.     
  79. extern pascal OSStatus AddModuleToAutoPushList(const char *driverName, const char *moduleName);
  80.     // This is a high-level entry point into the framework.
  81.     // This routine adds the given module to the autopush
  82.     // list associated with the given driver.
  83.     //
  84.     // Some important notes:
  85.     // 1. You must supply the driver name, not the port name.
  86.     //      For example, supply "mace", not "enet0".
  87.     // 2. The module is added to the end of the autopush list.
  88.     //      If you need any other position, you'll have to crack
  89.     //      open this abstraction layer.
  90.     // 3. A result of kOTAddressBusyErr means that too many
  91.     //      autopushes have been specified for the driver.
  92.     //      The limit is kOTAutopushMax.
  93.     // 4. A result of kEEXISTErr means that the module is already
  94.     //      in the autopush list for this driver.
  95.     
  96. extern pascal OSStatus RemoveModuleDriverAutoPushList(const char *driverName, const char *moduleName);
  97.     // This is a high-level entry point into the framework.
  98.     // This routine removes the given module from the autopush
  99.     // list associated with the driver.     The order of the remaining
  100.     // modules is preserved.
  101.     //
  102.     // Some important notes:
  103.     // 1. A result of kENOENTErr means that the module is not
  104.     //      in the autopush list for the driver.
  105.  
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.